class IUP_FLAT_LABEL
-- Creates an interface element that is a label, but it does not have native 
-- decorations. Its visual presentation can contain a text and/or an image.
--
-- It behaves just like an IUP_LABEL, but since it is not a native control it 
-- has more flexibility for additional options.
--
-- It inherits from IUP_CANVAS.
--
-- Notes:
--
-- The IUP_FLAT_LABEL can contain text and image simultaneously.
--
-- The natural size will be a combination of the size of the image and the 
-- title,  if any, plus PADDING and SPACING (if both image and title are 
-- present).
--
-- The IUP_LABEL SEPARATOR attribute to configure a separator (horizontal or 
-- vertical lines) is not supported. ELLIPSIS, MARKUP and WORDWRAP IUP_LABEL 
-- attributes are also not supported. Mnemonics are not supported.

inherit
	IUP_CANVAS
		redefine
			set_border
		end
	IUP_WIDGET_FGCOLOR
	IUP_WIDGET_SPACING
	IUP_WIDGET_TITLE
	IUP_WIDGET_PADDING
	IUP_WIDGET_FLAT_TEXT
	IUP_WIDGET_BACK_IMAGE_1
	IUP_WIDGET_FRONT_IMAGE_1
	IUP_WIDGET_IMAGE_1
	
create {ANY}
   flat_label
	
feature {ANY}
	
	flat_label (text: STRING)
	   -- Create a new flat label with the provided text.
		local
			a_flat_label: POINTER
		do
			a_flat_label := int_flat_label (text.to_external)
			set_widget(a_flat_label)
		end

	-- Attributes

	set_border (state: BOOLEAN)
		-- (creation only): Shows a border around the canvas. Default: "False".
		do
			Precursor (state)
		end

feature {}

	-- Internals

   int_flat_label (text: POINTER): POINTER
		external "plug_in"
      alias "{
         location: "${sys}/plugins"
         module_name: "iup"
         feature_name: "IupFlatLabel"
         }"
      end

end -- class IUP_FLAT_LABEL

-- The MIT License (MIT)

-- Copyright (c) 2018, 2019 by German A. Arias

-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to deal
-- in the Software without restriction, including without limitation the rights
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-- copies of the Software, and to permit persons to whom the Software is
-- furnished to do so, subject to the following conditions:
--
-- The above copyright notice and this permission notice shall be included in 
-- all copies or substantial portions of the Software.
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-- SOFTWARE.
